<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/


$router->group(['middleware' => 'auth'], function () use ($router) {
    $router->get('/',  function (){
        return view('public.index');
    });
    $router->get('/tuiguang', 'UserController@tuiguang');
    $router->get('/user', 'UserController@curUser');
    $router->get('/commission_log', 'UserController@commissionLog');
    $router->get('/withdraw', 'UserController@withdrawPage');
    $router->post('/withdraw', 'UserController@withdraw');
    $router->get('/recommend', 'UserController@recommend');
    $router->get('/tuiguang', 'UserController@tuiguang');
});

$router->post('/login', 'UserController@postLogin');
$router->post('/forget', 'UserController@postForget');
$router->post('/register', 'UserController@postRegister');
$router->post('/send_code', 'UserController@sendCode');
$router->get('/generate/{userId}', 'UserController@generateImg');



$router->get('admin/withdraw_excel', 'UserController@withdrawExcel');

$router->group(['prefix' => 'admin', 'middleware' => 'admin'], function () use ($router) {
    $router->get('/user', 'UserController@userList');
    $router->get('/withdraw', 'UserController@withdrawList');
    $router->post('/withdraw', 'UserController@confirmWithdraw');
    
    $router->get('/achievement', 'UserController@userAchievement');
    $router->post('/user_edit', 'UserController@userEdit');
    $router->post('/user_bind', 'UserController@userBind');
    $router->get('/miyou_user', 'UserController@miyouUserList');
    $router->post('admin/xls_upload', 'UserController@uploadXls');
    $router->post('/commission_upload', 'UserController@commissionUpload');
    $router->get('/profit', 'UserController@profit');
    $router->post('/set_session', 'UserController@setSession');

});
